const path = require('path')
module.exports = {

  babel: {
    plugins: [
      ["@babel/plugin-proposal-decorators", {
        legacy: true
      }]
    ]
  },
  webpack: {
    alias: {
      "@": path.join(__dirname, 'src'),
      "api": path.join(__dirname, 'src/api'),
      "components": path.join(__dirname, 'src/components'),
      "pages": path.join(__dirname, 'src/pages'),
      "utils": path.join(__dirname, 'src/utils'),
      "store": path.join(__dirname, 'src/store')
    },
  },

  devServer: {
    port: 9527,
    open: true,
    proxy: {
      '/api': { //需要代理的接口
        target: 'http://rap2api.taobao.org/app/mock/273079', //目标服务器
        changeOrigin: true, //是否跨域
        pathRewrite: {
          '^/api': '/api' //路径重写
        }
      }
    }
  }
};
